]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Fix switch animation between non-adjacent workspaces
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 31 Jul 2018 04:37:20 +0000 (06:37 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 31 Jul 2018 04:51:35 +0000 (06:51 +0200)
Commit e5c95b910d refactored the workspace animation to also handle
animations that involve all surrounding workspaces, but due to an
ill-advised review comment (guess whose) it broke the animation
for non-neighboring workspaces.

Update the code to handle correctly whether in a given direction:
 - we have the target workspace of a given index
 - we have a neighboring workspace
 - we don't need to animate anything

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/182

js/ui/windowManager.js

index a88d4f9a02bb19cb7b2e40598ba5320551a5b89d..d2d441d0c85449b3d20cf0b94e2cd05b68fa5745 100644 (file)
@@ -1856,8 +1856,14 @@ var WindowManager = new Lang.Class({
         let curWs = workspaceManager.get_workspace_by_index (from);
 
         for (let dir of Object.values(Meta.MotionDirection)) {
-            let ws = curWs.get_neighbor(dir);
-            if (ws == curWs || (to >= 0 && ws.index() != to)) {
+            let ws = null;
+
+            if (to < 0)
+                ws = curWs.get_neighbor(dir);
+            else if (dir == direction)
+                ws = workspaceManager.get_workspace_by_index(to);
+
+            if (ws == null || ws == curWs) {
                 switchData.surroundings[dir] = null;
                 continue;
             }